WEBAPP['rssArticle'] = function() {
	$('#commentForm').submit(function() {
		bum.fb.getUserInfo(function(user) {
			if (user == null) {
				// user not login yet, ask for login
				console.log('not login yet!');
				bum.fb.login(function(info) {
					console.log('login ok', info);
				});
			} else {
				console.log('already login', info);
			}
		});
		return false;
	});

	if (bum.fb.ok) {
		bum.fb.getUserInfo(bum.rss.showUserInfo);
	}
};

var bum = bum || {};
bum.rss = {
	showUserInfo : function(user) {
		console.log('show', user);
		if (user) {
			console.log('auth', bum.fb.auth);
			$('.cmt-form.no-fb').removeClass('no-fb').find('.cmt-user').html(
					'<img src="' + user.avatar + '" width="30" height="30" class="avatar" />' + '<strong>' + user.name + '</strong>'
							+ ' (<a href="javascript:bum.fb.logout();" title="Thoát">Thoát</a>)').end();
			// $('.commentbox .btnSubmit').after('<label class="sharefb"><input type="checkbox" value="1" checked>Chia sẻ Facebook</label>');
		}
	}
};

$(function() {
	bum.listener.add(bum.fb.events.FB_OK, function() {
		bum.fb.getUserInfo(bum.rss.showUserInfo);
	});
});